Repository navigation
Reserve remix storage before taking the project save lock - #75
Merged
Merged
Conversation
Remixing asked the Rotur storage ledger for a hold while holding the parent project's save lock, so a slow or unreachable Rotur stalled uploads, history writes and project.json flushes on the parent. The remix now reserves the hold against an unlocked copy of the parent, then reloads the parent under the lock and replays the hold only if the fork's storage still matches. A parent that changed in between releases the hold and tries again, with a 409 after three tries like project updates. Holds are released in a deferred block, and a successful remix keeps and settles its hold as before.
…rop a moved comment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remixing reserved the remixer's storage with the Rotur storage ledger, a network call, while holding the parent project's save lock. While Rotur was slow or down, uploads, history writes and the project.json flush on reads of the parent all waited behind it. This was the last Rotur call left under a save lock after #73.
Remixes now use the same record-and-replay approach as project updates:
projectSaveLock(id), reload the parent, redo every check and the fork preparation, and replay the hold. If the parent changed so the computed storage differs, the attempt releases its hold and retries. After three tries it returns 409project_changed, like updates.defer, so a throw can't leave it reserved. A successful remix keeps and settles its hold as before.forkProjectForkeeps its signature, and now also releases its hold if a call throws.Verification
project-remix.test.oslruns the real handler with stubs. It covers:osl testpasses 60, lsp check and conventions are clean, and the route dump is identical.Known and accepted:
There is no visible change.